package cn.mw.cmdb.entity;

import cn.mw.cmdb.service.ServiceChoose;
import cn.mw.cmdb.service.impl.InventoryWorkAssetsServiceImpl;
import cn.mw.components.mongodb.anno.AutoId;
import cn.mw.components.mongodb.anno.CMDBProperty;
import cn.mw.components.mongodb.anno.CMDBRelations;
import cn.mw.components.mongodb.anno.DataAuthAnno;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author shenwenyi
 * @Date 2024/6/4 12:04
 * @PackageName:cn.mw.cmdb.entity
 * @ClassName: InventoryWorkAssetsMapper
 * @Description: TODD
 * @Version 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document("mw_cmdbmd_inventory_work_assets")
public class InventoryWorkAssets implements ServiceChoose {

    @AutoId
    @CMDBProperty
    @Schema(description = "主键id")
    private String id;

    @CMDBProperty(searchType = PropertyTypeString.ID)
    @Schema(description = "盘点任务id")
    private String inventoryWorkInfoId;

    @CMDBProperty
    @Schema(description = "资产id")
    private String assetsId;

    @CMDBProperty
    @Schema(description = "数量")
    private Integer count;

    @CMDBProperty
    @Schema(description = "描述")
    private String desc;

    @CMDBProperty
    @Schema(description = "盘点数量")
    private Integer inventoryCount;

    @CMDBProperty
    @Schema(description = "创建人")
    protected String creator;

    @CMDBProperty
    @Schema(description = "创建时间")
    protected Date createDate;

    @CMDBProperty
    @Schema(description = "修改人")
    protected String modifier;

    @CMDBProperty
    @Schema(description = "修改时间")
    protected Date modificationDate;

    @Transient
    @Schema(description = "资产编号")
    private String assetCoding;

    @Transient
    @Schema(description = "资产状态")
    private String assetStatus;

    @Transient
    @Schema(description = "实例名称")
    private String instanceName;

    @Transient
    @Schema(description = "模型分组名称")
    private String modelGroupName;

    //品牌id
    @Transient
    @Schema(description = "品牌")
    private Object brand;

    @Transient
    @Schema(description = "规格型号")
    private String specifications;

    @Transient
    private List<Long> users;

    @Transient
    private List<Long> orgIds;

    @Transient
    @Schema(description = "负责人")
    private String principal;

    @Transient
    @Schema(description = "所属组织/机构")
    private String orgName;

    @Transient
    @Schema(description = "序列号")
    private String productId;

    @Transient
    @Schema(description = "结果")
    private String result;

    @Schema(description = "逻辑删除")
    @CMDBProperty(logicDel = true)
    protected Boolean delFlag = false;

    @CMDBProperty
    @Schema(description = "图片地址")
    private List<String> imgUrl;

    @Override
    public String getServiceId() {
        return InventoryWorkAssetsServiceImpl.ID;
    }
}
